import http from '@/utils/http'

interface BasicParams {
    dtoName: string // 参考后端接口文档
    queryId: string // 参考confluence上的页面需求SQL标识
    version: string // 参考confluence上的页面需求SQL版本号
    menuName: string // 菜单的标识，与菜单管理配置保持一致
    usage: string // 接口后缀，标识用途
}
/*
  eg./ims-tworkgz-service/viewCstHistory/getCstHistory
*/

/** 获取 ownerType信息 */
export function getOwnerType({ shopId, productType }: { shopId: string, productType:string }): Promise<any> {
  const data = {
    dtoName: 'ViewFEOLOwnerTypeDTO',
    queryId: 'GetOwnerTypeList',
    usage: 'ProductionType',
    version: '80001',
    shopId,
    productType
  }
  return http.request({
    url: '/ims-tworkgz-service/viewFeolWipInput/getOwnerType',
    method: 'POST',
    data
  })
}

/** 获取 owner信息 */
export function getOwner({ shopId, ownerType, productType }: {shopId: string, ownerType: string, productType:string }): Promise<any> {
  const data = {
    dtoName: 'ViewFEOLOwnerDTO',
    queryId: 'GetOwnerList',
    usage: 'ProductionType',
    version: '80012',
    shopId,
    ownerType,
    productType
  }
  return http.request({
    url: '/ims-tworkgz-service/viewFeolWipInput/getOwner',
    method: 'POST',
    data
  })
}
